# 该策略为测试逻辑
import numpy as np
import pandas as pd


# 接收一个history_candles,增加新列['signal'] 1 为买入信号,2为卖出信号
def testStartegy(data_df):
    global highest_price, lowest_price
    history_candles = data_df.copy()
    history_candles.sort_values(by="ts", ascending=True, inplace=True)
    history_candles.reset_index(drop=True, inplace=True)  # 此时0对应的是最老的candle
    # 此时得到的history_candlse索引是倒序的
    # 全给买入信号
    for i in range(len(history_candles)):
        #直接全给买入信号
        history_candles.loc[i,"signal"] = 1
    if 'Unnamed: 0' in history_candles:
        history_candles.drop(columns=['Unnamed: 0'], inplace=True)
    return history_candles


if __name__ == '__main__':
    data_df = pd.read_csv('../data_info/bit_coin.csv')
    result = testStartegy(data_df)
    result.to_csv("./test.csv", index=False)
